{extend name='admin@main'}
{block name="button"}
<!--{if auth("store/goods/add")}-->
<button data-open='{:url("add")}' data-title="添加轮播图" class='layui-btn layui-btn-sm layui-btn-primary'>添加轮播图</button>
<!--{/if}-->
<!--{if auth("store/goods/remove")}-->
<button data-action='{:url("remove")}' data-rule="id#{key}" class='layui-btn layui-btn-sm layui-btn-primary'>删除轮播图</button>
<!--{/if}-->
{/block}
{block name="content"}
<div class="think-box-shadow">
    <table class="layui-table margin-top-10" lay-skin="line">
        {notempty name='list'}
        <thead>
        <tr>
            <th class='list-table-check-td think-checkbox'>
                <input data-auto-none data-check-target='.list-check-box' type='checkbox'>
            </th>
            <!--<th class='list-table-sort-td'>-->
                <!--<button type="button" data-reload class="layui-btn layui-btn-xs">刷 新</button>-->
            <!--</th>-->
            <th class='text-left nowrap' width="20%">轮播图ID</th>
            <th class='text-left nowrap' width="20%">轮播图片</th>
            <th class='text-left nowrap' width="20%">是否跳转</th>
            <th class='text-left nowrap' width="20%">状态</th>
            <th class='text-left nowrap' width="20%">操作</th>
        </tr>
        </thead>
        {/notempty}
        <tbody>
        {foreach $list as $key=>$vo}
        <tr data-dbclick>
            <td class='list-table-check-td think-checkbox'><input class="list-check-box" value='{$vo.id}' type='checkbox'></td>
           <td class='text-left nowrap'>
                <div class="inline-block">
                   {$vo.id|default=0}
                </div>
            </td>
            <td class='text-left nowrap'>
                <div class="inline-block">
                    {notempty name='vo.img'}
                    <img data-tips-image style="width:60px;height:60px" src="{$vo.img|default=''}" class="margin-right-5 text-top">
                    {/notempty}
                </div>
            </td>
            <td class='text-left nowrap'>
                <div class="inline-block">
                    {if $vo.is_jump == 0}
                    否
                    {else}
                    是
                    {/if}
                </div>
            </td>
            <td class='text-left nowrap'>
                <div class="inline-block">
                    {if $vo.status == 0}
                     禁用
                    {else}
                     启用
                    {/if}
                </div>
            </td>
            <td class='text-left nowrap'>

                <div class="nowrap margin-bottom-5">
                    <a data-dbclick class="layui-btn layui-btn-sm" data-open='{:url("edit")}?id={$vo.id}'>编 辑</a>
                    <a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要删除数据吗?" data-action="{:url('remove')}" data-value="id#{$vo.id}">删 除</a>
                    {if isset($vo.status) and $vo.status eq 1}
                    <a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('forbid')}" data-value="id#{$vo.id};status#0">禁 用</a>
                    {else}
                    <a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('resume')}" data-value="id#{$vo.id};status#1">启 用</a>
                    {/if}
                </div>

            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>

    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}

</div>
<script>
    $(".ahide").hide();
    //询问框
function examine(id){
    var status="publish";
    var index=layer.confirm('该商品是否通过审核', {
        btn: ['通过','拒绝'] //按钮
    }, function(){
        $("#ahide"+id).attr('data-value','id#'+id+';status#'+status);
        $("#ahide"+id).trigger("click")
        layer.close(index);
        return true;
    }, function(){
        status="refused"
        $("#ahide"+id).attr('data-value','id#'+id+';status#'+status);
        $("#ahide"+id).trigger("click")
        return false;
    });
    return false;
}



</script>

{/block}
